/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.WxUserTicket;
import org.apache.ibatis.jdbc.SQL;

public class WxUserTicketSqlProvider {

    /* @mbggenerated */
    public String insertSelective(WxUserTicket record) {
        return new SQL() {
            {
                INSERT_INTO("wx_user_ticket");

                if (record.getOpenId() != null) {
                    VALUES("open_id", "#{openId,jdbcType=VARCHAR}");
                }

                if (record.getSceneStr() != null) {
                    VALUES("scene_str", "#{sceneStr,jdbcType=VARCHAR}");
                }

                if (record.getTicket() != null) {
                    VALUES("ticket", "#{ticket,jdbcType=VARCHAR}");
                }

                if (record.getExpireTime() != null) {
                    VALUES("expire_time", "#{expireTime,jdbcType=TIMESTAMP}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(WxUserTicket record) {
        return new SQL() {
            {
                UPDATE("wx_user_ticket");

                if (record.getOpenId() != null)

                {
                    SET("open_id = #{openId,jdbcType=VARCHAR}");
                }

                if (record.getSceneStr() != null)

                {
                    SET("scene_str = #{sceneStr,jdbcType=VARCHAR}");
                }

                if (record.getTicket() != null)

                {
                    SET("ticket = #{ticket,jdbcType=VARCHAR}");
                }

                if (record.getExpireTime() != null)

                {
                    SET("expire_time = #{expireTime,jdbcType=TIMESTAMP}");
                }

                if (record.getCreateTime() != null)

                {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}